//
//  DiseaseDanXiangTableViewCell.m
//  MyYiJianKangApp
//
//  Created by 张国文 on 16/5/3.
//  Copyright © 2016年 hangzhouyijiyin. All rights reserved.
//

#import "DiseaseDanXiangTableViewCell.h"

@implementation DiseaseDanXiangTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self addMySubview];
    }
    return self;
}

// 布局
- (void)addMySubview
{
    self.diseaseImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater,  15 * kAdjustParamater, 77 * kAdjustParamater, 77 * kAdjustParamater)];
    self.diseaseImageV.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    self.diseaseImageV.layer.cornerRadius = self.diseaseImageV.width / 2;
    self.diseaseImageV.layer.masksToBounds = YES;
    [self.contentView addSubview:_diseaseImageV];
    
    self.diseaseNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.diseaseImageV.right + 6 * kAdjustParamater, self.diseaseImageV.top + 10 * kAdjustParamater, 200 * kAdjustParamater, 15 * kAdjustParamater)];
   // self.diseaseNameLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    self.diseaseNameLabel.textColor = [UIColor blackColor];
    self.diseaseNameLabel.textAlignment = NSTextAlignmentLeft;
    self.diseaseNameLabel.font = [UIFont systemFontOfSize:k16Big];
    [self.contentView addSubview:_diseaseNameLabel];
    
    self.diseaseIntroduceLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.diseaseNameLabel.left, self.diseaseNameLabel.bottom + 5 * kAdjustParamater, 256 * kAdjustParamater, 35 * kAdjustParamater)];
  //  self.diseaseIntroduceLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    self.diseaseIntroduceLabel.textColor = [UIColor blackColor];
    self.diseaseIntroduceLabel.numberOfLines = 0;
    self.diseaseIntroduceLabel.font = [UIFont systemFontOfSize:k13Big];
    [self.contentView addSubview:_diseaseIntroduceLabel];
    
    
}

- (void)setModel:(DanXiangArrayModel *)model
{
    NSString *imageUrl = [model.icon_url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
    [self.diseaseImageV sd_setImageWithURL:[NSURL URLWithString:imageUrl] placeholderImage:[UIImage imageNamed:@""]];
    
    self.diseaseNameLabel.text = model.name;
    
   // self.diseaseIntroduceLabel.text = model.summary;
     self.diseaseIntroduceLabel.text = model.short_discription;
    // 设置行间距
    [self.diseaseIntroduceLabel setAttributedText:[[NetStatusHandle shareHandle] setHangJianJvOfLabel:self.diseaseIntroduceLabel.text lineHeight:3]];
    self.diseaseIntroduceLabel.lineBreakMode = NSLineBreakByTruncatingTail;
}




@end
